package com.zoe.wan.android.example.repository.data

import android.os.Parcel
import android.os.Parcelable


/**
 *  通用的搜索热点和常用网站的数据实体
 */
data class CommonSearchData(
    val name: String?,
    var link: String?
) : Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readString()
    ) {
    }

    override fun describeContents(): Int {
        return 0
    }

    override fun writeToParcel(p0: Parcel, p1: Int) {
        p0.writeString(name)
        p0.writeString(link)
    }

    companion object CREATOR : Parcelable.Creator<CommonSearchData> {
        override fun createFromParcel(parcel: Parcel): CommonSearchData {
            return CommonSearchData(parcel)
        }

        override fun newArray(size: Int): Array<CommonSearchData?> {
            return arrayOfNulls(size)
        }
    }
}